package com.feicheng.common.advice;


import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Function;

@Slf4j
@Configuration
public class OrderAdviceAiConfig {

    public record OrderSearchModel(String orderid, String nc, String tel) {}

    @Bean
    @Description("处理订单退订和取消预定")
    public Function<OrderSearchModel, String> cancelOrder() {
        return orderSearchModel -> {
            log.info("订单号:"+orderSearchModel.orderid()+" 昵称："+orderSearchModel.nc()+" 电话："+orderSearchModel.tel());
            return "退订成功";
        };
    }
}
